import json

from flask import jsonify


class User:

    def __init__(self, username, password):
        self.username = username
        self.password = password

    def to_json(self):
        return self.__dict__


if __name__ == '__main__':
    u = User('高嘉银', '123456')
    u2 = User('高嘉银', '123456')
    list1 = [u, u2]
    print(json.dumps([user.to_json() for user in list1], ensure_ascii=False))
